<?php
#
# author: Cody Sorgenfrey
# (c)2012 South Hill Calvary Chapel
#

include_once("../mysql/database_info.php");
include_once("common.php");
include_once("../mysql/common.php");
$table = "sermons";
connect_select_test($table);
$title = "Recent Sermons";
$meta_key= 'sermons, teaching, Bible, God, Jesus, Word, Old Testament, New Testament, recent, scripture';
$meta_desc="The most recent Bible teachings at South Hill Calvary Chapel.";
$morehtml= null;
$morejava= null;
startPage($title, $meta_key, $meta_desc, $morehtml, $morejava);

printf("<div><a href='./sermon.php?service=Sunday'><h4>Sunday Service</h4></a></div>\n");
$query="SELECT * FROM $table WHERE service='Sunday' ORDER BY date DESC";
$result=mysql_query($query) or die (mysql_error());
msermon_table($result,4,$table);
printf("</div>\n\n");

printf("<div class='pageContent'>\n");
printf("<div><a href='./sermon.php?service=Wednesday'><h4>Wednesday Service</h4></a></div>\n");
$query="SELECT * FROM $table WHERE service='Wednesday' ORDER BY date DESC";
$result=mysql_query($query) or die (mysql_error());
msermon_table($result,4,$table);
printf("</div>\n\n");

printf("<div class='pageContent'>\n");
printf("<div><a href='./sermon.php?service=%s'><h4>High School</h4></a></div>\n", "High%20School");
$query="SELECT * FROM $table WHERE `service`='High School' ORDER BY date DESC";
$result=mysql_query($query) or die (mysql_error());
msermon_table($result,4,$table);
printf("</div>\n\n");

printf("<div class='pageContent'>\n");
printf("<div><a href='./sermon.php?service=Jr+High'><h4>Jr High Service</h4></a></div>\n");
$query="SELECT * FROM $table WHERE service='Jr High' ORDER BY date DESC";
$result=mysql_query($query) or die (mysql_error());
msermon_table($result,4,$table);

printf("</div>\n\n");
printf("<div class='pageContent'>\n");

printf("<div><a href='./sermon.php?service=Retreat'><h4>Retreats</h4></a></div>\n");
$query="SELECT * FROM $table WHERE service='Retreat' ORDER BY date DESC";
$result=mysql_query($query) or die (mysql_error());
msermon_table($result,4,$table);

mysql_close();
endPage();

?>